To ascertain if the GLX extension is defined for an X server, use
Bool glXQueryExtension ( Display *dpy , int *error _base , int *event _base ) ;
dpy specifies the connection to the X server. False is returned if the extension is not present. error _base is used to return the value of the first error code. The constant error codes should be added to this base to get the actual value.
event _base is included for future extension. GLX does not currently define any events.
When the GLX definition is extended, it may exist in multiple versions. Use
Bool glXQueryVersion ( Display *dpy , int *major , int *minor ) ;
to discover which version of GLX is available. Upon success, major and minor are filled in with the major and minor versions of the extension implementation. If the client and server both have the same major version number then they are compatible and the minor version that is returned is the minimum of the two minor version numbers.
major and minor do not return values if they are specified as NULL.
glXQueryVersion returns True if it succeeds and False if it fails. If it fails, major and minor are not updated.